﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;

namespace ArchiveLinkServiceHost
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
#if (DEBUG)
            ArchiveLinkServiceHost service = new ArchiveLinkServiceHost();
            service.StartSvc();
            System.Threading.Thread.Sleep(int.MaxValue);
#else
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[] 
			    { 
				    new ArchiveLinkServiceHost() 
			    }; 
            try
            {

                ServicesToRun[0].EventLog.WriteEntry("startup");
                ServiceBase.Run(ServicesToRun);

            }
            catch(Exception ex)
            {
                ServicesToRun[0].EventLog.WriteEntry("error:" +  ex.ToString());

            }
#endif
        }
    }
}
